<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>交换节点</title>
    <style>
        .c1{
            background-color: blue;
            text-align: right;
        }
        .c2{
            background-color: pink;
        }
    </style>
</head>
<body>
<div class="c1">我喜欢你的眼睛你的鼻子你的耳朵你的嘴巴</div>
<div class="c2">c2</div>
<script>
    var c1=document.querySelector(".c1");
    var c2=document.querySelector(".c2");
    var a;

    new Promise(function(resolve,reject){
       resolve(c2);
       setTimeout(function(){
            document.body.appendChild(a);
       },2000)
    }).then(function(c2){
        document.body.insertBefore(c2,c1);
        setTimeout(function(){
            a=document.body.removeChild(c2)
        },1000)
    });


</script>
</body>
</html>